cmake_minimum_required(VERSION 3.20) # 或者更高版本

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# add_compile_definitions(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
add_compile_options(-g -O0 -fno-inline-functions)
# 查找Boost
find_package(Boost COMPONENTS context system thread serialization REQUIRED) # Asio作为Boost的一部分，通常需要system和thread组件


if(BUILD_TEST)
    add_definitions(-DBUILD_TEST)
endif()

# 递归查找当前目录及子目录下的所有 .cpp 文件
file(GLOB_RECURSE UTILS_SOURCES "./src/*.cpp")

# 添加执行目标
add_library(${UTILS} STATIC ${UTILS_SOURCES})

target_include_directories(${UTILS} PUBLIC
    ./include 
)
# 链接Boost.Asio
target_link_libraries(${UTILS} PUBLIC
    ${Boost_LIBRARIES}
)